#pragma once

#ifndef _CORE_STANZA_HANDLER_H_
#define _CORE_STANZA_HANDLER_H_

#include "Poco\XML\XMLString.h"
#include "Poco\SAX\Attributes.h"

namespace ExamSystem
{
    using Poco::XML::XMLString;
    using Poco::XML::XMLChar;
    using Poco::XML::Attributes;

    class CXMLConnection;

    /**************************************************************************\
     Component:     CStanzaHandler
     Description:
        This is the base class for all stanza handlers. When parsing, the 
        CCoreXMLHandler will pass the content of a package to the corresponding 
        handler.
    \**************************************************************************/
    class CStanzaHandler
    {
    protected:
        virtual ~CStanzaHandler(void) {}

    public:
        virtual void startElement(CXMLConnection *connection, const XMLString& uri, const XMLString& localName, const XMLString& qname, const Attributes& attributes) = 0;
        virtual void endElement(CXMLConnection *connection, const XMLString& uri, const XMLString& localName, const XMLString& qname) = 0;
        virtual void characters(CXMLConnection *connection, const XMLChar ch[], int start, int length) = 0;
    };

}

#endif